//
//  BaseObject.m
//  SuperRadio
//
//  Created by Damon on 14/12/17.
//  Copyright (c) 2014年 三个臭皮匠. All rights reserved.
//

#import "BaseObject.h"

@implementation BaseObject



- (id)initWithDictionary:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        // 利用kvc给对象赋值
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}


+ (NSMutableArray *)modelsWithDicArr:(NSArray *)arr
{
    NSMutableArray *modelsArr = [NSMutableArray array];
    
    for (NSDictionary *dic in arr) {
        
        id movie = [[self alloc] initWithDictionary:dic];
        [modelsArr addObject:movie];
        [movie release];
    }
    
    return modelsArr;
}

// KVC纠错方法
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
    
    
}

- (id)valueForUndefinedKey:(NSString *)key
{
    
    
    return nil;
}


@end
